//
//  MMLabel.m
//  EraPig
//
//  Created by Mac_Mini on 2021/2/24.
//

#import "MMLabel.h"

@implementation MMLabel

/// 自定义label
/// @param frame frame
/// @param fontsize 字体大小<使用的是系统默认的字体>
/// @param text 字体的颜色
/// @param textcolor 字体的颜色
/// @param alignment 对齐方式
- (MMLabel *)initWithFrame:(CGRect)frame
                  fontSize:(CGFloat)fontsize
                      text:(NSString *)text
                 textColor:(UIColor *)textcolor
             textAlignment:(NSTextAlignment)alignment{
    return [self initWithFrame:frame fontSize:fontsize text:text textColor:textcolor textAlignment:alignment numberOfLines:1];
}


/// 自定义label
/// @param frame frame
/// @param fontsize 字体大小<使用的是系统默认的字体>
/// @param text 字体的颜色
/// @param textcolor 字体的颜色
/// @param alignment 对齐方式
/// @param lines 行数 <默认1行>
- (MMLabel *)initWithFrame:(CGRect)frame
                  fontSize:(CGFloat)fontsize
                      text:(NSString *)text
                 textColor:(UIColor *)textcolor
             textAlignment:(NSTextAlignment)alignment
             numberOfLines:(NSInteger)lines{
    if (self = [super initWithFrame:frame]) {
        self.font = [UIFont systemFontOfSize:fontsize];
        self.text = text;
        self.textColor = textcolor;
        self.textAlignment = alignment;
        self.numberOfLines = lines;
    }
    return self;
}
@end
